#include "stdio.h"
#include "stdlib.h"
#include "string.h"
unsigned char my_chrInStr(char chr, const char *str)
{
    while (*str)
    {
        if (chr == *str)
            return 1;
        str++;
    }
    return 0;
}

char *my_strtok(char *s, const char *delim)
{
    static char *text = 0;
    if (text == 0)
        text = s;
    if (text == 0)
        return 0;
    char *head = text;
    while (*text && !my_chrInStr(*text, delim))
    {
        text++;
    }
    while (*text && my_chrInStr(*text, delim))
    {
        *text = '\0';
        text++;
    }
    if (*text == '\0')
        text = 0;
    return head;
}

int my_atoi(const char *str)
{
    int num = 0;
    int i = 0;
    int n = strlen(str);
    while (i < n)
    {
        num = num * 10 + str[i] - '0';
        ++i;
    }
    return num;
}
